
* THE HABSBURG MANIFESTO DATASET - HMD 
* Szöcsik, E., Zuber, C. I., & Howe, P. J. (2023). Lipset and Rokkan's missing case: Introducing the Habsburg Manifesto Dataset. Party Politics, 13540688231185671.
** Replication file for data preparation 2


**************************************************
**** PREPARING ELECTION-SPECIFIC MEASURES OF APPEAL BY PARTY FOR THE ANALYSIS ***** 

cd  "/Users/christina/Dropbox/collab-projects/Habsburg/Publications/2 Lipset and Rokkans missing case - introducing HMD/Data and analysis/1 data preparation"
 

****************************
****** Create positions in 1897 EAs***** 


use "manifestos1", clear

keep if doc_type == "EA"
keep if elec == 1

*Define which parties were nationalist according to core issue in EA 1907 
*Definition of nationalist party: majority of EA 1907 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_E1 = 0
replace nationalistparty_E1 = 1 if sharenatdoc2 >= 0.5
label var nationalistparty_E1 "nationalist party E1"


******Calculate variables for 1897 elections - averaging across documents where several docs per party were found 
*issue areas
bysort party1: egen forpolE1 = mean (forpol)
bysort party1: egen polsysE1 = mean (polsys)
bysort party1: egen econE1 = mean (econ)
bysort party1: egen socpolE1 = mean (socpol)
bysort party1: egen religmorE1 = mean (religmor)
bysort party1: egen nationalE1 = mean (national)

bysort party1: egen classE1 = mean (class)
bysort party1: egen nationalityE1 = mean (nationality)
bysort party1: egen religiousE1 = mean (religious)

bysort party1: egen territorialE1 = mean (territorial)
bysort party1: egen ideologicalE1 = mean (ideological)
bysort party1: egen genderE1 = mean (gender)
bysort party1: egen ageE1 = mean (age)


*Creating salience vars for issues in 1897 averaging across EAs if several
bysort party1: egen greatergermanyE1 = mean(greatergermany)
bysort party1: egen warE1 = mean(war)
bysort party1: egen milservE1 = mean(milserv)
bysort party1: egen citarmyE1 = mean(citarmy)

bysort party1: egen demE1 = mean(dem)
bysort party1: egen elecinE1 = mean(elecin)
bysort party1: egen parlE1 = mean(parl)
bysort party1: egen civlibE1 = mean(civlib)
bysort party1: egen rulelawE1 = mean(rulelaw)
bysort party1: egen spechunE1 = mean(spechun)
bysort party1: egen fedE1 = mean(fed)
bysort party1: egen secE1 = mean(sec)

bysort party1: egen capismE1 = mean(capism)
bysort party1: egen ftradeE1 = mean(ftrade)
bysort party1: egen exploitE1 = mean(exploit)
bysort party1: egen growthE1 = mean(growth)
bysort party1: egen unempE1 = mean(unemp)
bysort party1: egen debtE1 = mean(debt)
bysort party1: egen interestE1 = mean(interest)
bysort party1: egen taxE1 = mean(tax)
bysort party1: egen corpE1 = mean(corp)
bysort party1: egen coopE1 = mean(coop)
bysort party1: egen trunionE1 = mean(trunion)
bysort party1: egen infraE1 = mean(infra)
bysort party1: egen pubsubE1 = mean(pubsub)
bysort party1: egen agriE1 = mean(agri)

bysort party1: egen soceqE1 = mean(soceq)
bysort party1: egen socsecE1 = mean(socsec)
bysort party1: egen pubhealthE1 = mean(pubhealth)
bysort party1: egen pubeducE1 = mean(pubeduc)
bysort party1: egen classconE1 = mean(classcon)

bysort party1: egen tradvalE1 = mean(tradval)
bysort party1: egen sepchE1 = mean(sepch)

bysort party1: egen nationalismE1 = mean(nationalism)
bysort party1: egen langrightE1 = mean(langright)
bysort party1: egen grouprepE1 = mean(grouprep)
bysort party1: egen immigE1 = mean(immig)

bysort party1: egen otherissueE1 = mean(otherissue)


**# Bookmark #2
*Creating position vars for issues in 1897 averaging across EAs if several
bysort party1: egen p_greatergermanyE1 = mean(p_greatergermany)
bysort party1: egen p_warE1 = mean(p_war)
bysort party1: egen p_milservE1 = mean(p_milserv)
bysort party1: egen p_citarmyE1 = mean(p_citarmy)

bysort party1: egen p_demE1 = mean(p_dem)
bysort party1: egen p_elecinE1 = mean(p_elecin)
bysort party1: egen p_parlE1 = mean(p_parl)
bysort party1: egen p_civlibE1 = mean(p_civlib)
bysort party1: egen p_rulelawE1 = mean(p_rulelaw)
bysort party1: egen p_spechunE1 = mean(p_spechun)
bysort party1: egen p_fedE1 = mean(p_fed)
bysort party1: egen p_secE1 = mean(p_sec)

bysort party1: egen p_capismE1 = mean(p_capism)
bysort party1: egen p_ftradeE1 = mean(p_ftrade)
bysort party1: egen p_exploitE1 = mean(p_exploit)
bysort party1: egen p_growthE1 = mean(p_growth)
bysort party1: egen p_unempE1 = mean(p_unemp)
bysort party1: egen p_debtE1 = mean(p_debt)
bysort party1: egen p_interestE1 = mean(p_interest)
bysort party1: egen p_taxE1 = mean(p_tax)
bysort party1: egen p_corpE1 = mean(p_corp)
bysort party1: egen p_coopE1 = mean(p_coop)
bysort party1: egen p_trunionE1 = mean(p_trunion)
bysort party1: egen p_infraE1 = mean(p_infra)
bysort party1: egen p_pubsubE1 = mean(p_pubsub)
bysort party1: egen p_agriE1 = mean(p_agri)

bysort party1: egen p_soceqE1 = mean(p_soceq)
bysort party1: egen p_socsecE1 = mean(p_socsec)
bysort party1: egen p_pubhealthE1 = mean(p_pubhealth)
bysort party1: egen p_pubeducE1 = mean(p_pubeduc)
bysort party1: egen p_classconE1 = mean(p_classcon)

bysort party1: egen p_tradvalE1 = mean(p_tradval)
bysort party1: egen p_sepchE1 = mean(p_sepch)

bysort party1: egen p_nationalismE1 = mean(p_nationalism)
bysort party1: egen p_langrightE1 = mean(p_langright)
bysort party1: egen p_grouprepE1 = mean(p_grouprep)
bysort party1: egen p_immigE1 = mean(p_immig)


*Creating salience vars for groups in 1897 averaging across EAs if several
bysort party1: egen civicE1 = mean(civic)

bysort party1: egen uppclassE1 = mean(uppclass)
bysort party1: egen midclassE1 = mean(midclass)
bysort party1: egen lowclassE1 = mean(lowclass)
bysort party1: egen capistsE1 = mean(capists)
bysort party1: egen workersE1 = mean(workers)
bysort party1: egen arisE1 = mean(aris)
bysort party1: egen farmersE1 = mean(farmers)
bysort party1: egen merchE1 = mean(merch)
bysort party1: egen craftE1 = mean(craft)
bysort party1: egen civservE1 = mean(civserv)
bysort party1: egen soldiersE1 = mean(soldiers)
bysort party1: egen intellecE1 = mean(intellec)
bysort party1: egen producE1 = mean(produc)
bysort party1: egen consumE1 = mean(consum)

bysort party1: egen bosE1 = mean(bos)
bysort party1: egen croE1 = mean(cro)
bysort party1: egen czeE1 = mean(cze)
bysort party1: egen gerE1 = mean(ger)
bysort party1: egen hunE1 = mean(hun)
bysort party1: egen itaE1 = mean(ita)
bysort party1: egen jewE1 = mean(jew)
bysort party1: egen nomadicE1 = mean(nomadic)
bysort party1: egen polE1 = mean(pol)
bysort party1: egen romE1 = mean(rom)
bysort party1: egen rutE1 = mean(rut)
bysort party1: egen skE1 = mean(sk)
bysort party1: egen sloE1 = mean(slo)
bysort party1: egen slavE1 = mean(slav)
bysort party1: egen nongerE1 = mean(nonger)
bysort party1: egen nonhunE1 = mean(nonhun)

bysort party1: egen christE1 = mean(christ)
bysort party1: egen romcatE1 = mean(romcat)
bysort party1: egen protE1 = mean(prot)

bysort party1: egen provinceE1 = mean(province)
bysort party1: egen regionE1 = mean(region)
bysort party1: egen cityE1 = mean(city)
bysort party1: egen localE1 = mean(local)

bysort party1: egen conservativesE1 = mean(conservatives)
bysort party1: egen clericalsE1 = mean(clericals)
bysort party1: egen liberalsE1 = mean(liberals)
bysort party1: egen nationalistsE1 = mean(nationalists)
bysort party1: egen socialistsE1 = mean(socialists)

bysort party1: egen menE1 = mean(men)
bysort party1: egen womenE1 = mean(women)

bysort party1: egen oldE1 = mean(old)
bysort party1: egen youngE1 = mean(young)

bysort party1: egen othergrE1 = mean(othergr)


*Creating position vars for groups in 1907 averaging across EAs if several
bysort party1: egen p_civicE1 = mean(p_civic)

bysort party1: egen p_uppclassE1 = mean(p_uppclass)
bysort party1: egen p_midclassE1 = mean(p_midclass)
bysort party1: egen p_lowclassE1 = mean(p_lowclass)
bysort party1: egen p_capitalistsE1 = mean(p_capitalists)
bysort party1: egen p_workersE1 = mean(p_workers)
bysort party1: egen p_arisE1 = mean(p_aris)
bysort party1: egen p_farmersE1 = mean(p_farmers)
bysort party1: egen p_merchE1 = mean(p_merch)
bysort party1: egen p_craftE1 = mean(p_craft)
bysort party1: egen p_civservE1 = mean(p_civserv)
bysort party1: egen p_soldiersE1 = mean(p_soldiers)
bysort party1: egen p_intellecE1 = mean(p_intellec)
bysort party1: egen p_producE1 = mean(p_produc)
bysort party1: egen p_consumE1 = mean(p_consum)

bysort party1: egen p_bosE1 = mean(p_bos)
bysort party1: egen p_croE1 = mean(p_cro)
bysort party1: egen p_czeE1 = mean(p_cze)
bysort party1: egen p_gerE1 = mean(p_ger)
bysort party1: egen p_hunE1 = mean(p_hun)
bysort party1: egen p_itaE1 = mean(p_ita)
bysort party1: egen p_jewE1 = mean(p_jew)
bysort party1: egen p_nomadicE1 = mean(p_nomadic)
bysort party1: egen p_polE1 = mean(p_pol)
bysort party1: egen p_romE1 = mean(p_rom)
bysort party1: egen p_rutE1 = mean(p_rut)
bysort party1: egen p_skE1 = mean(p_sk)
bysort party1: egen p_sloE1 = mean(p_slo)
bysort party1: egen p_slavE1 = mean(p_slav)
bysort party1: egen p_nongerE1 = mean(p_nonger)
bysort party1: egen p_nonhunE1 = mean(p_nonhun)

bysort party1: egen p_christE1 = mean(p_christ)
bysort party1: egen p_romcatE1 = mean(p_romcat)
bysort party1: egen p_protE1 = mean(p_prot)

bysort party1: egen p_provinceE1 = mean(p_province)
bysort party1: egen p_regionE1 = mean(p_region)
bysort party1: egen p_cityE1 = mean(p_city)
bysort party1: egen p_localE1 = mean(p_local)

bysort party1: egen p_conservativesE1 = mean(p_conservatives)
bysort party1: egen p_clericalsE1 = mean(p_clericals)
bysort party1: egen p_liberalsE1 = mean(p_liberals)
bysort party1: egen p_nationalistsE1 = mean(p_nationalists)
bysort party1: egen p_socialistsE1 = mean(p_socialists)

bysort party1: egen p_menE1 = mean(p_men)
bysort party1: egen p_womenE1 = mean(p_women)

bysort party1: egen p_oldE1 = mean(p_old)
bysort party1: egen p_youngE1 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1
keep party1 *E1
save "manifestos-EA1897.dta", replace






**# Bookmark #3
****************************
****** Create positions based on 1901 EAs***** 

use "manifestos1", clear

keep if doc_type == "EA"
keep if elec == 2

*Define which parties were nationalist according to core issue in EA 1901 
*Definition of nationalist party: majority of EA 1907 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_E2 = 0
replace nationalistparty_E2 = 1 if sharenatdoc2 >= 0.5

label var nationalistparty_E2 "nationalist party E2"


******Calculate variables for 1901 elections - averaging across documents where several docs per party were found 
*issue areas
bysort party1: egen forpolE2 = mean (forpol)
bysort party1: egen polsysE2 = mean (polsys)
bysort party1: egen econE2 = mean (econ)
bysort party1: egen socpolE2 = mean (socpol)
bysort party1: egen religmorE2 = mean (religmor)
bysort party1: egen nationalE2 = mean (national)

bysort party1: egen classE2 = mean (class)
bysort party1: egen nationalityE2 = mean (nationality)
bysort party1: egen religiousE2 = mean (religious)

bysort party1: egen territorialE2 = mean (territorial)
bysort party1: egen ideologicalE2 = mean (ideological)
bysort party1: egen genderE2 = mean (gender)
bysort party1: egen ageE2 = mean (age)


*Creating salience vars for issues in 1901 averaging across EAs if several
bysort party1: egen greatergermanyE2 = mean(greatergermany)
bysort party1: egen warE2 = mean(war)
bysort party1: egen milservE2 = mean(milserv)
bysort party1: egen citarmyE2 = mean(citarmy)

bysort party1: egen demE2 = mean(dem)
bysort party1: egen elecinE2 = mean(elecin)
bysort party1: egen parlE2 = mean(parl)
bysort party1: egen civlibE2 = mean(civlib)
bysort party1: egen rulelawE2 = mean(rulelaw)
bysort party1: egen spechunE2 = mean(spechun)
bysort party1: egen fedE2 = mean(fed)
bysort party1: egen secE2 = mean(sec)

bysort party1: egen capismE2 = mean(capism)
bysort party1: egen ftradeE2 = mean(ftrade)
bysort party1: egen exploitE2 = mean(exploit)
bysort party1: egen growthE2 = mean(growth)
bysort party1: egen unempE2 = mean(unemp)
bysort party1: egen debtE2 = mean(debt)
bysort party1: egen interestE2 = mean(interest)
bysort party1: egen taxE2 = mean(tax)
bysort party1: egen corpE2 = mean(corp)
bysort party1: egen coopE2 = mean(coop)
bysort party1: egen trunionE2 = mean(trunion)
bysort party1: egen infraE2 = mean(infra)
bysort party1: egen pubsubE2 = mean(pubsub)
bysort party1: egen agriE2 = mean(agri)

bysort party1: egen soceqE2 = mean(soceq)
bysort party1: egen socsecE2 = mean(socsec)
bysort party1: egen pubhealthE2 = mean(pubhealth)
bysort party1: egen pubeducE2 = mean(pubeduc)
bysort party1: egen classconE2 = mean(classcon)

bysort party1: egen tradvalE2 = mean(tradval)
bysort party1: egen sepchE2 = mean(sepch)

bysort party1: egen nationalismE2 = mean(nationalism)
bysort party1: egen langrightE2 = mean(langright)
bysort party1: egen grouprepE2 = mean(grouprep)
bysort party1: egen immigE2 = mean(immig)

bysort party1: egen otherissueE2 = mean(otherissue)

*Creating position vars for issues in 1901 averaging across EAs if several
bysort party1: egen p_greatergermanyE2 = mean(p_greatergermany)
bysort party1: egen p_warE2 = mean(p_war)
bysort party1: egen p_milservE2 = mean(p_milserv)
bysort party1: egen p_citarmyE2 = mean(p_citarmy)

bysort party1: egen p_demE2 = mean(p_dem)
bysort party1: egen p_elecinE2 = mean(p_elecin)
bysort party1: egen p_parlE2 = mean(p_parl)
bysort party1: egen p_civlibE2 = mean(p_civlib)
bysort party1: egen p_rulelawE2 = mean(p_rulelaw)
bysort party1: egen p_spechunE2 = mean(p_spechun)
bysort party1: egen p_fedE2 = mean(p_fed)
bysort party1: egen p_secE2 = mean(p_sec)

bysort party1: egen p_capismE2 = mean(p_capism)
bysort party1: egen p_ftradeE2 = mean(p_ftrade)
bysort party1: egen p_exploitE2 = mean(p_exploit)
bysort party1: egen p_growthE2 = mean(p_growth)
bysort party1: egen p_unempE2 = mean(p_unemp)
bysort party1: egen p_debtE2 = mean(p_debt)
bysort party1: egen p_interestE2 = mean(p_interest)
bysort party1: egen p_taxE2 = mean(p_tax)
bysort party1: egen p_corpE2 = mean(p_corp)
bysort party1: egen p_coopE2 = mean(p_coop)
bysort party1: egen p_trunionE2 = mean(p_trunion)
bysort party1: egen p_infraE2 = mean(p_infra)
bysort party1: egen p_pubsubE2 = mean(p_pubsub)
bysort party1: egen p_agriE2 = mean(p_agri)

bysort party1: egen p_soceqE2 = mean(p_soceq)
bysort party1: egen p_socsecE2 = mean(p_socsec)
bysort party1: egen p_pubhealthE2 = mean(p_pubhealth)
bysort party1: egen p_pubeducE2 = mean(p_pubeduc)
bysort party1: egen p_classconE2 = mean(p_classcon)

bysort party1: egen p_tradvalE2 = mean(p_tradval)
bysort party1: egen p_sepchE2 = mean(p_sepch)

bysort party1: egen p_nationalismE2 = mean(p_nationalism)
bysort party1: egen p_langrightE2 = mean(p_langright)
bysort party1: egen p_grouprepE2 = mean(p_grouprep)
bysort party1: egen p_immigE2 = mean(p_immig)


*Creating salience vars for groups in 1901 averaging across EAs if several
bysort party1: egen civicE2 = mean(civic)

bysort party1: egen uppclassE2 = mean(uppclass)
bysort party1: egen midclassE2 = mean(midclass)
bysort party1: egen lowclassE2 = mean(lowclass)
bysort party1: egen capistsE2 = mean(capists)
bysort party1: egen workersE2 = mean(workers)
bysort party1: egen arisE2 = mean(aris)
bysort party1: egen farmersE2 = mean(farmers)
bysort party1: egen merchE2 = mean(merch)
bysort party1: egen craftE2 = mean(craft)
bysort party1: egen civservE2 = mean(civserv)
bysort party1: egen soldiersE2 = mean(soldiers)
bysort party1: egen intellecE2 = mean(intellec)
bysort party1: egen producE2 = mean(produc)
bysort party1: egen consumE2 = mean(consum)

bysort party1: egen bosE2 = mean(bos)
bysort party1: egen croE2 = mean(cro)
bysort party1: egen czeE2 = mean(cze)
bysort party1: egen gerE2 = mean(ger)
bysort party1: egen hunE2 = mean(hun)
bysort party1: egen itaE2 = mean(ita)
bysort party1: egen jewE2 = mean(jew)
bysort party1: egen nomadicE2 = mean(nomadic)
bysort party1: egen polE2 = mean(pol)
bysort party1: egen romE2 = mean(rom)
bysort party1: egen rutE2 = mean(rut)
bysort party1: egen skE2 = mean(sk)
bysort party1: egen sloE2 = mean(slo)
bysort party1: egen slavE2 = mean(slav)
bysort party1: egen nongerE2 = mean(nonger)
bysort party1: egen nonhunE2 = mean(nonhun)

bysort party1: egen christE2 = mean(christ)
bysort party1: egen romcatE2 = mean(romcat)
bysort party1: egen protE2 = mean(prot)


bysort party1: egen provinceE2 = mean(province)
bysort party1: egen regionE2 = mean(region)
bysort party1: egen cityE2 = mean(city)
bysort party1: egen localE2 = mean(local)

bysort party1: egen conservativesE2 = mean(conservatives)
bysort party1: egen clericalsE2 = mean(clericals)
bysort party1: egen liberalsE2 = mean(liberals)
bysort party1: egen nationalistsE2 = mean(nationalists)
bysort party1: egen socialistsE2 = mean(socialists)

bysort party1: egen menE2 = mean(men)
bysort party1: egen womenE2 = mean(women)

bysort party1: egen oldE2 = mean(old)
bysort party1: egen youngE2 = mean(young)

bysort party1: egen othergrE2 = mean(othergr)


*Creating position vars for groups in 1901 averaging across EAs if several
bysort party1: egen p_civicE2 = mean(p_civic)

bysort party1: egen p_uppclassE2 = mean(p_uppclass)
bysort party1: egen p_midclassE2 = mean(p_midclass)
bysort party1: egen p_lowclassE2 = mean(p_lowclass)
bysort party1: egen p_capitalistsE2 = mean(p_capitalists)
bysort party1: egen p_workersE2 = mean(p_workers)
bysort party1: egen p_arisE2 = mean(p_aris)
bysort party1: egen p_farmersE2 = mean(p_farmers)
bysort party1: egen p_merchE2 = mean(p_merch)
bysort party1: egen p_craftE2 = mean(p_craft)
bysort party1: egen p_civservE2 = mean(p_civserv)
bysort party1: egen p_soldiersE2 = mean(p_soldiers)
bysort party1: egen p_intellecE2 = mean(p_intellec)
bysort party1: egen p_producE2 = mean(p_produc)
bysort party1: egen p_consumE2 = mean(p_consum)

bysort party1: egen p_bosE2 = mean(p_bos)
bysort party1: egen p_croE2 = mean(p_cro)
bysort party1: egen p_czeE2 = mean(p_cze)
bysort party1: egen p_gerE2 = mean(p_ger)
bysort party1: egen p_hunE2 = mean(p_hun)
bysort party1: egen p_itaE2 = mean(p_ita)
bysort party1: egen p_jewE2 = mean(p_jew)
bysort party1: egen p_nomadicE2 = mean(p_nomadic)
bysort party1: egen p_polE2 = mean(p_pol)
bysort party1: egen p_romE2 = mean(p_rom)
bysort party1: egen p_rutE2 = mean(p_rut)
bysort party1: egen p_skE2 = mean(p_sk)
bysort party1: egen p_sloE2 = mean(p_slo)
bysort party1: egen p_slavE2 = mean(p_slav)
bysort party1: egen p_nongerE2 = mean(p_nonger)
bysort party1: egen p_nonhunE2 = mean(p_nonhun)

bysort party1: egen p_christE2 = mean(p_christ)
bysort party1: egen p_romcatE2 = mean(p_romcat)
bysort party1: egen p_protE2 = mean(p_prot)

bysort party1: egen p_provinceE2 = mean(p_province)
bysort party1: egen p_regionE2 = mean(p_region)
bysort party1: egen p_cityE2 = mean(p_city)
bysort party1: egen p_localE2 = mean(p_local)

bysort party1: egen p_conservativesE2 = mean(p_conservatives)
bysort party1: egen p_clericalsE2 = mean(p_clericals)
bysort party1: egen p_liberalsE2 = mean(p_liberals)
bysort party1: egen p_nationalistsE2 = mean(p_nationalists)
bysort party1: egen p_socialistsE2 = mean(p_socialists)

bysort party1: egen p_menE2 = mean(p_men)
bysort party1: egen p_womenE2 = mean(p_women)

bysort party1: egen p_oldE2 = mean(p_old)
bysort party1: egen p_youngE2 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1

keep party1 *E2
save "manifestos-EA1901.dta", replace





****************************
****** Create positions in 1907 EAs***** 

use "manifestos1", clear

keep if doc_type == "EA"
keep if elec == 3

*Define which parties were nationalist according to core issue in EA 1907 
*Definition of nationalist party: majority of EA 1907 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_E3 = 0
replace nationalistparty_E3 = 1 if sharenatdoc2 >= 0.5

label var nationalistparty_E3 "nationalist party E3"


******Calculate variables for 1907 elections - averaging across documents where several docs per party were found 
*issue areas
bysort party1: egen forpolE3 = mean (forpol)
bysort party1: egen polsysE3 = mean (polsys)
bysort party1: egen econE3 = mean (econ)
bysort party1: egen socpolE3 = mean (socpol)
bysort party1: egen religmorE3 = mean (religmor)
bysort party1: egen nationalE3 = mean (national)

bysort party1: egen classE3 = mean (class)
bysort party1: egen nationalityE3 = mean (nationality)
bysort party1: egen religiousE3 = mean (religious)

bysort party1: egen territorialE3 = mean (territorial)
bysort party1: egen ideologicalE3 = mean (ideological)
bysort party1: egen genderE3 = mean (gender)
bysort party1: egen ageE3 = mean (age)


*Creating salience vars for issues in 1907 averaging across EAs if several
bysort party1: egen greatergermanyE3 = mean(greatergermany)
bysort party1: egen warE3 = mean(war)
bysort party1: egen milservE3 = mean(milserv)
bysort party1: egen citarmyE3 = mean(citarmy)

bysort party1: egen demE3 = mean(dem)
bysort party1: egen elecinE3 = mean(elecin)
bysort party1: egen parlE3 = mean(parl)
bysort party1: egen civlibE3 = mean(civlib)
bysort party1: egen rulelawE3 = mean(rulelaw)
bysort party1: egen spechunE3 = mean(spechun)
bysort party1: egen fedE3 = mean(fed)
bysort party1: egen secE3 = mean(sec)

bysort party1: egen capismE3 = mean(capism)
bysort party1: egen ftradeE3 = mean(ftrade)
bysort party1: egen exploitE3 = mean(exploit)
bysort party1: egen growthE3 = mean(growth)
bysort party1: egen unempE3 = mean(unemp)
bysort party1: egen debtE3 = mean(debt)
bysort party1: egen interestE3 = mean(interest)
bysort party1: egen taxE3 = mean(tax)
bysort party1: egen corpE3 = mean(corp)
bysort party1: egen coopE3 = mean(coop)
bysort party1: egen trunionE3 = mean(trunion)
bysort party1: egen infraE3 = mean(infra)
bysort party1: egen pubsubE3 = mean(pubsub)
bysort party1: egen agriE3 = mean(agri)

bysort party1: egen soceqE3 = mean(soceq)
bysort party1: egen socsecE3 = mean(socsec)
bysort party1: egen pubhealthE3 = mean(pubhealth)
bysort party1: egen pubeducE3 = mean(pubeduc)
bysort party1: egen classconE3 = mean(classcon)

bysort party1: egen tradvalE3 = mean(tradval)
bysort party1: egen sepchE3 = mean(sepch)

bysort party1: egen nationalismE3 = mean(nationalism)
bysort party1: egen langrightE3 = mean(langright)
bysort party1: egen grouprepE3 = mean(grouprep)
bysort party1: egen immigE3 = mean(immig)

bysort party1: egen otherissueE3 = mean(otherissue)


*Creating position vars for issues in 1907 averaging across EAs if several
bysort party1: egen p_greatergermanyE3 = mean(p_greatergermany)
bysort party1: egen p_warE3 = mean(p_war)
bysort party1: egen p_milservE3 = mean(p_milserv)
bysort party1: egen p_citarmyE3 = mean(p_citarmy)

bysort party1: egen p_demE3 = mean(p_dem)
bysort party1: egen p_elecinE3 = mean(p_elecin)
bysort party1: egen p_parlE3 = mean(p_parl)
bysort party1: egen p_civlibE3 = mean(p_civlib)
bysort party1: egen p_rulelawE3 = mean(p_rulelaw)
bysort party1: egen p_spechunE3 = mean(p_spechun)
bysort party1: egen p_fedE3 = mean(p_fed)
bysort party1: egen p_secE3 = mean(p_sec)

bysort party1: egen p_capismE3 = mean(p_capism)
bysort party1: egen p_ftradeE3 = mean(p_ftrade)
bysort party1: egen p_exploitE3 = mean(p_exploit)
bysort party1: egen p_growthE3 = mean(p_growth)
bysort party1: egen p_unempE3 = mean(p_unemp)
bysort party1: egen p_debtE3 = mean(p_debt)
bysort party1: egen p_interestE3 = mean(p_interest)
bysort party1: egen p_taxE3 = mean(p_tax)
bysort party1: egen p_corpE3 = mean(p_corp)
bysort party1: egen p_coopE3 = mean(p_coop)
bysort party1: egen p_trunionE3 = mean(p_trunion)
bysort party1: egen p_infraE3 = mean(p_infra)
bysort party1: egen p_pubsubE3 = mean(p_pubsub)
bysort party1: egen p_agriE3 = mean(p_agri)

bysort party1: egen p_soceqE3 = mean(p_soceq)
bysort party1: egen p_socsecE3 = mean(p_socsec)
bysort party1: egen p_pubhealthE3 = mean(p_pubhealth)
bysort party1: egen p_pubeducE3 = mean(p_pubeduc)
bysort party1: egen p_classconE3 = mean(p_classcon)

bysort party1: egen p_tradvalE3 = mean(p_tradval)
bysort party1: egen p_sepchE3 = mean(p_sepch)

bysort party1: egen p_nationalismE3 = mean(p_nationalism)
bysort party1: egen p_langrightE3 = mean(p_langright)
bysort party1: egen p_grouprepE3 = mean(p_grouprep)
bysort party1: egen p_immigE3 = mean(p_immig)


*Creating salience vars for groups in 1907 averaging across EAs if several
bysort party1: egen civicE3 = mean(civic)

bysort party1: egen uppclassE3 = mean(uppclass)
bysort party1: egen midclassE3 = mean(midclass)
bysort party1: egen lowclassE3 = mean(lowclass)
bysort party1: egen capistsE3 = mean(capists)
bysort party1: egen workersE3 = mean(workers)
bysort party1: egen arisE3 = mean(aris)
bysort party1: egen farmersE3 = mean(farmers)
bysort party1: egen merchE3 = mean(merch)
bysort party1: egen craftE3 = mean(craft)
bysort party1: egen civservE3 = mean(civserv)
bysort party1: egen soldiersE3 = mean(soldiers)
bysort party1: egen intellecE3 = mean(intellec)
bysort party1: egen producE3 = mean(produc)
bysort party1: egen consumE3 = mean(consum)

bysort party1: egen bosE3 = mean(bos)
bysort party1: egen croE3 = mean(cro)
bysort party1: egen czeE3 = mean(cze)
bysort party1: egen gerE3 = mean(ger)
bysort party1: egen hunE3 = mean(hun)
bysort party1: egen itaE3 = mean(ita)
bysort party1: egen jewE3 = mean(jew)
bysort party1: egen nomadicE3 = mean(nomadic)
bysort party1: egen polE3 = mean(pol)
bysort party1: egen romE3 = mean(rom)
bysort party1: egen rutE3 = mean(rut)
bysort party1: egen skE3 = mean(sk)
bysort party1: egen sloE3 = mean(slo)
bysort party1: egen slavE3 = mean(slav)
bysort party1: egen nongerE3 = mean(nonger)
bysort party1: egen nonhunE3 = mean(nonhun)

bysort party1: egen christE3 = mean(christ)
bysort party1: egen romcatE3 = mean(romcat)
bysort party1: egen protE3 = mean(prot)

bysort party1: egen provinceE3 = mean(province)
bysort party1: egen regionE3 = mean(region)
bysort party1: egen cityE3 = mean(city)
bysort party1: egen localE3 = mean(local)

bysort party1: egen conservativesE3 = mean(conservatives)
bysort party1: egen clericalsE3 = mean(clericals)
bysort party1: egen liberalsE3 = mean(liberals)
bysort party1: egen nationalistsE3 = mean(nationalists)
bysort party1: egen socialistsE3 = mean(socialists)

bysort party1: egen menE3 = mean(men)
bysort party1: egen womenE3 = mean(women)

bysort party1: egen oldE3 = mean(old)
bysort party1: egen youngE3 = mean(young)

bysort party1: egen othergrE3 = mean(othergr)


*Creating position vars for groups in 1907 averaging across EAs if several
bysort party1: egen p_civicE3 = mean(p_civic)

bysort party1: egen p_uppclassE3 = mean(p_uppclass)
bysort party1: egen p_midclassE3 = mean(p_midclass)
bysort party1: egen p_lowclassE3 = mean(p_lowclass)
bysort party1: egen p_capitalistsE3 = mean(p_capitalists)
bysort party1: egen p_workersE3 = mean(p_workers)
bysort party1: egen p_arisE3 = mean(p_aris)
bysort party1: egen p_farmersE3 = mean(p_farmers)
bysort party1: egen p_merchE3 = mean(p_merch)
bysort party1: egen p_craftE3 = mean(p_craft)
bysort party1: egen p_civservE3 = mean(p_civserv)
bysort party1: egen p_soldiersE3 = mean(p_soldiers)
bysort party1: egen p_intellecE3 = mean(p_intellec)
bysort party1: egen p_producE3 = mean(p_produc)
bysort party1: egen p_consumE3 = mean(p_consum)

bysort party1: egen p_bosE3 = mean(p_bos)
bysort party1: egen p_croE3 = mean(p_cro)
bysort party1: egen p_czeE3 = mean(p_cze)
bysort party1: egen p_gerE3 = mean(p_ger)
bysort party1: egen p_hunE3 = mean(p_hun)
bysort party1: egen p_itaE3 = mean(p_ita)
bysort party1: egen p_jewE3 = mean(p_jew)
bysort party1: egen p_nomadicE3 = mean(p_nomadic)
bysort party1: egen p_polE3 = mean(p_pol)
bysort party1: egen p_romE3 = mean(p_rom)
bysort party1: egen p_rutE3 = mean(p_rut)
bysort party1: egen p_skE3 = mean(p_sk)
bysort party1: egen p_sloE3 = mean(p_slo)
bysort party1: egen p_slavE3 = mean(p_slav)
bysort party1: egen p_nongerE3 = mean(p_nonger)
bysort party1: egen p_nonhunE3 = mean(p_nonhun)

bysort party1: egen p_christE3 = mean(p_christ)
bysort party1: egen p_romcatE3 = mean(p_romcat)
bysort party1: egen p_protE3 = mean(p_prot)

bysort party1: egen p_provinceE3 = mean(p_province)
bysort party1: egen p_regionE3 = mean(p_region)
bysort party1: egen p_cityE3 = mean(p_city)
bysort party1: egen p_localE3 = mean(p_local)

bysort party1: egen p_conservativesE3 = mean(p_conservatives)
bysort party1: egen p_clericalsE3 = mean(p_clericals)
bysort party1: egen p_liberalsE3 = mean(p_liberals)
bysort party1: egen p_nationalistsE3 = mean(p_nationalists)
bysort party1: egen p_socialistsE3 = mean(p_socialists)

bysort party1: egen p_menE3 = mean(p_men)
bysort party1: egen p_womenE3 = mean(p_women)

bysort party1: egen p_oldE3 = mean(p_old)
bysort party1: egen p_youngE3 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1
keep party1 *E3
save "manifestos-EA1907.dta", replace





*****************

****** Create positions in 1911 EAs***** 

use "manifestos1", clear

keep if doc_type == "EA"
keep if elec == 4

*Define which parties were nationalist according to core issue in EA 1911
*Definition of nationalist party: majority of EA 1911 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_E4 = 0
replace nationalistparty_E4 = 1 if sharenatdoc2 >= 0.5

label var nationalistparty_E4 "nationalist party E4"


******Calculate variables for 1911 elections - averaging across documents where several docs per party were found 
*issue areas
bysort party1: egen forpolE4 = mean (forpol)
bysort party1: egen polsysE4 = mean (polsys)
bysort party1: egen econE4 = mean (econ)
bysort party1: egen socpolE4 = mean (socpol)
bysort party1: egen religmorE4 = mean (religmor)
bysort party1: egen nationalE4 = mean (national)

bysort party1: egen classE4 = mean (class)
bysort party1: egen nationalityE4 = mean (nationality)
bysort party1: egen religiousE4 = mean (religious)

bysort party1: egen territorialE4 = mean (territorial)
bysort party1: egen ideologicalE4 = mean (ideological)
bysort party1: egen genderE4 = mean (gender)
bysort party1: egen ageE4 = mean (age)


*Creating salience vars for issues in 1911 averaging across EAs if several
bysort party1: egen greatergermanyE4 = mean(greatergermany)
bysort party1: egen warE4 = mean(war)
bysort party1: egen milservE4 = mean(milserv)
bysort party1: egen citarmyE4 = mean(citarmy)

bysort party1: egen demE4 = mean(dem)
bysort party1: egen elecinE4 = mean(elecin)
bysort party1: egen parlE4 = mean(parl)
bysort party1: egen civlibE4 = mean(civlib)
bysort party1: egen rulelawE4 = mean(rulelaw)
bysort party1: egen spechunE4 = mean(spechun)
bysort party1: egen fedE4 = mean(fed)
bysort party1: egen secE4 = mean(sec)

bysort party1: egen capismE4 = mean(capism)
bysort party1: egen ftradeE4 = mean(ftrade)
bysort party1: egen exploitE4 = mean(exploit)
bysort party1: egen growthE4 = mean(growth)
bysort party1: egen unempE4 = mean(unemp)
bysort party1: egen debtE4 = mean(debt)
bysort party1: egen interestE4 = mean(interest)
bysort party1: egen taxE4 = mean(tax)
bysort party1: egen corpE4 = mean(corp)
bysort party1: egen coopE4 = mean(coop)
bysort party1: egen trunionE4 = mean(trunion)
bysort party1: egen infraE4 = mean(infra)
bysort party1: egen pubsubE4 = mean(pubsub)
bysort party1: egen agriE4 = mean(agri)

bysort party1: egen soceqE4 = mean(soceq)
bysort party1: egen socsecE4 = mean(socsec)
bysort party1: egen pubhealthE4 = mean(pubhealth)
bysort party1: egen pubeducE4 = mean(pubeduc)
bysort party1: egen classconE4 = mean(classcon)

bysort party1: egen tradvalE4 = mean(tradval)
bysort party1: egen sepchE4 = mean(sepch)

bysort party1: egen nationalismE4 = mean(nationalism)
bysort party1: egen langrightE4 = mean(langright)
bysort party1: egen grouprepE4 = mean(grouprep)
bysort party1: egen immigE4 = mean(immig)

bysort party1: egen otherissueE4 = mean(otherissue)


*Creating position vars for issues in 1911 averaging across EAs if several

bysort party1: egen p_greatergermanyE4 = mean(p_greatergermany)
bysort party1: egen p_warE4 = mean(p_war)
bysort party1: egen p_milservE4 = mean(p_milserv)
bysort party1: egen p_citarmyE4 = mean(p_citarmy)

bysort party1: egen p_demE4 = mean(p_dem)
bysort party1: egen p_elecinE4 = mean(p_elecin)
bysort party1: egen p_parlE4 = mean(p_parl)
bysort party1: egen p_civlibE4 = mean(p_civlib)
bysort party1: egen p_rulelawE4 = mean(p_rulelaw)
bysort party1: egen p_spechunE4 = mean(p_spechun)
bysort party1: egen p_fedE4 = mean(p_fed)
bysort party1: egen p_secE4 = mean(p_sec)

bysort party1: egen p_capismE4 = mean(p_capism)
bysort party1: egen p_ftradeE4 = mean(p_ftrade)
bysort party1: egen p_exploitE4 = mean(p_exploit)
bysort party1: egen p_growthE4 = mean(p_growth)
bysort party1: egen p_unempE4 = mean(p_unemp)
bysort party1: egen p_debtE4 = mean(p_debt)
bysort party1: egen p_interestE4 = mean(p_interest)
bysort party1: egen p_taxE4 = mean(p_tax)
bysort party1: egen p_corpE4 = mean(p_corp)
bysort party1: egen p_coopE4 = mean(p_coop)
bysort party1: egen p_trunionE4 = mean(p_trunion)
bysort party1: egen p_infraE4 = mean(p_infra)
bysort party1: egen p_pubsubE4 = mean(p_pubsub)
bysort party1: egen p_agriE4 = mean(p_agri)

bysort party1: egen p_soceqE4 = mean(p_soceq)
bysort party1: egen p_socsecE4 = mean(p_socsec)
bysort party1: egen p_pubhealthE4 = mean(p_pubhealth)
bysort party1: egen p_pubeducE4 = mean(p_pubeduc)
bysort party1: egen p_classconE4 = mean(p_classcon)

bysort party1: egen p_tradvalE4 = mean(p_tradval)
bysort party1: egen p_sepchE4 = mean(p_sepch)

bysort party1: egen p_nationalismE4 = mean(p_nationalism)
bysort party1: egen p_langrightE4 = mean(p_langright)
bysort party1: egen p_grouprepE4 = mean(p_grouprep)
bysort party1: egen p_immigE4 = mean(p_immig)



*Creating salience vars for groups in 1911 averaging across EAs if several
bysort party1: egen civicE4 = mean(civic)

bysort party1: egen uppclassE4 = mean(uppclass)
bysort party1: egen midclassE4 = mean(midclass)
bysort party1: egen lowclassE4 = mean(lowclass)
bysort party1: egen capistsE4 = mean(capists)
bysort party1: egen workersE4 = mean(workers)
bysort party1: egen arisE4 = mean(aris)
bysort party1: egen farmersE4 = mean(farmers)
bysort party1: egen merchE4 = mean(merch)
bysort party1: egen craftE4 = mean(craft)
bysort party1: egen civservE4 = mean(civserv)
bysort party1: egen soldiersE4 = mean(soldiers)
bysort party1: egen intellecE4 = mean(intellec)
bysort party1: egen producE4 = mean(produc)
bysort party1: egen consumE4 = mean(consum)

bysort party1: egen bosE4 = mean(bos)
bysort party1: egen croE4 = mean(cro)
bysort party1: egen czeE4 = mean(cze)
bysort party1: egen gerE4 = mean(ger)
bysort party1: egen hunE4 = mean(hun)
bysort party1: egen itaE4 = mean(ita)
bysort party1: egen jewE4 = mean(jew)
bysort party1: egen nomadicE4 = mean(nomadic)
bysort party1: egen polE4 = mean(pol)
bysort party1: egen romE4 = mean(rom)
bysort party1: egen rutE4 = mean(rut)
bysort party1: egen skE4 = mean(sk)
bysort party1: egen sloE4 = mean(slo)
bysort party1: egen slavE4 = mean(slav)
bysort party1: egen nongerE4 = mean(nonger)
bysort party1: egen nonhunE4 = mean(nonhun)

bysort party1: egen christE4 = mean(christ)
bysort party1: egen romcatE4 = mean(romcat)
bysort party1: egen protE4 = mean(prot)

bysort party1: egen provinceE4 = mean(province)
bysort party1: egen regionE4 = mean(region)
bysort party1: egen cityE4 = mean(city)
bysort party1: egen localE4 = mean(local)

bysort party1: egen conservativesE4 = mean(conservatives)
bysort party1: egen clericalsE4 = mean(clericals)
bysort party1: egen liberalsE4 = mean(liberals)
bysort party1: egen nationalistsE4 = mean(nationalists)
bysort party1: egen socialistsE4 = mean(socialists)

bysort party1: egen menE4 = mean(men)
bysort party1: egen womenE4 = mean(women)

bysort party1: egen oldE4 = mean(old)
bysort party1: egen youngE4 = mean(young)

bysort party1: egen othergrE4 = mean(othergr)


*Creating position vars for groups in 1911 averaging across EAs if several
bysort party1: egen p_civicE4 = mean(p_civic)

bysort party1: egen p_uppclassE4 = mean(p_uppclass)
bysort party1: egen p_midclassE4 = mean(p_midclass)
bysort party1: egen p_lowclassE4 = mean(p_lowclass)
bysort party1: egen p_capitalistsE4 = mean(p_capitalists)
bysort party1: egen p_workersE4 = mean(p_workers)
bysort party1: egen p_arisE4 = mean(p_aris)
bysort party1: egen p_farmersE4 = mean(p_farmers)
bysort party1: egen p_merchE4 = mean(p_merch)
bysort party1: egen p_craftE4 = mean(p_craft)
bysort party1: egen p_civservE4 = mean(p_civserv)
bysort party1: egen p_soldiersE4 = mean(p_soldiers)
bysort party1: egen p_intellecE4 = mean(p_intellec)
bysort party1: egen p_producE4 = mean(p_produc)
bysort party1: egen p_consumE4 = mean(p_consum)

bysort party1: egen p_bosE4 = mean(p_bos)
bysort party1: egen p_croE4 = mean(p_cro)
bysort party1: egen p_czeE4 = mean(p_cze)
bysort party1: egen p_gerE4 = mean(p_ger)
bysort party1: egen p_hunE4 = mean(p_hun)
bysort party1: egen p_itaE4 = mean(p_ita)
bysort party1: egen p_jewE4 = mean(p_jew)
bysort party1: egen p_nomadicE4 = mean(p_nomadic)
bysort party1: egen p_polE4 = mean(p_pol)
bysort party1: egen p_romE4 = mean(p_rom)
bysort party1: egen p_rutE4 = mean(p_rut)
bysort party1: egen p_skE4 = mean(p_sk)
bysort party1: egen p_sloE4 = mean(p_slo)
bysort party1: egen p_slavE4 = mean(p_slav)
bysort party1: egen p_nongerE4 = mean(p_nonger)
bysort party1: egen p_nonhunE4 = mean(p_nonhun)

bysort party1: egen p_christE4 = mean(p_christ)
bysort party1: egen p_romcatE4 = mean(p_romcat)
bysort party1: egen p_protE4 = mean(p_prot)

bysort party1: egen p_provinceE4 = mean(p_province)
bysort party1: egen p_regionE4 = mean(p_region)
bysort party1: egen p_cityE4 = mean(p_city)
bysort party1: egen p_localE4 = mean(p_local)

bysort party1: egen p_conservativesE4 = mean(p_conservatives)
bysort party1: egen p_clericalsE4 = mean(p_clericals)
bysort party1: egen p_liberalsE4 = mean(p_liberals)
bysort party1: egen p_nationalistsE4 = mean(p_nationalists)
bysort party1: egen p_socialistsE4 = mean(p_socialists)

bysort party1: egen p_menE4 = mean(p_men)
bysort party1: egen p_womenE4 = mean(p_women)

bysort party1: egen p_oldE4 = mean(p_old)
bysort party1: egen p_youngE4 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1
keep party1 *E4
save "manifestos-EA1911.dta", replace




********** 

* now repeat this fun procedure for the pre 1906 and post 1906 Party Programmes we collected


****************************
****** Create positions in pre and post suffrage PPs***** 

use "manifestos1", clear

keep if doc_type == "PP"

***** code positions according to PP for pre-suffrage period 

keep if postsuffrage_pp == 0


*Define which parties were nationalist according to core issue in EA 1907 
*Definition of nationalist party: majority of EA 1907 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_P1 = 0
replace nationalistparty_P1 = 1 if sharenatdoc2 >= 0.5
label var nationalistparty_P1 "nationalist party PP1"


******Calculate variables for 1907 elections - averaging across documents where several docs per party were found 
*issue areas
bysort party1: egen forpolP1 = mean (forpol)
bysort party1: egen polsysP1 = mean (polsys)
bysort party1: egen econP1 = mean (econ)
bysort party1: egen socpolP1 = mean (socpol)
bysort party1: egen religmorP1 = mean (religmor)
bysort party1: egen nationalP1 = mean (national)

bysort party1: egen classP1 = mean (class)
bysort party1: egen nationalityP1 = mean (nationality)
bysort party1: egen religiousP1 = mean (religious)

bysort party1: egen territorialP1 = mean (territorial)
bysort party1: egen ideologicalP1 = mean (ideological)
bysort party1: egen genderP1 = mean (gender)
bysort party1: egen ageP1 = mean (age)


*Creating salience vars for issues in 1907 averaging across EAs if several
bysort party1: egen greatergermanyP1 = mean(greatergermany)
bysort party1: egen warP1 = mean(war)
bysort party1: egen milservP1 = mean(milserv)
bysort party1: egen citarmyP1 = mean(citarmy)

bysort party1: egen demP1 = mean(dem)
bysort party1: egen elecinP1 = mean(elecin)
bysort party1: egen parlP1 = mean(parl)
bysort party1: egen civlibP1 = mean(civlib)
bysort party1: egen rulelawP1 = mean(rulelaw)
bysort party1: egen spechunP1 = mean(spechun)
bysort party1: egen fedP1 = mean(fed)
bysort party1: egen secP1 = mean(sec)

bysort party1: egen capismP1 = mean(capism)
bysort party1: egen ftradeP1 = mean(ftrade)
bysort party1: egen exploitP1 = mean(exploit)
bysort party1: egen growthP1 = mean(growth)
bysort party1: egen unempP1 = mean(unemp)
bysort party1: egen debtP1 = mean(debt)
bysort party1: egen interestP1 = mean(interest)
bysort party1: egen taxP1 = mean(tax)
bysort party1: egen corpP1 = mean(corp)
bysort party1: egen coopP1 = mean(coop)
bysort party1: egen trunionP1 = mean(trunion)
bysort party1: egen infraP1 = mean(infra)
bysort party1: egen pubsubP1 = mean(pubsub)
bysort party1: egen agriP1 = mean(agri)


bysort party1: egen soceqP1 = mean(soceq)
bysort party1: egen socsecP1 = mean(socsec)
bysort party1: egen pubhealthP1 = mean(pubhealth)
bysort party1: egen pubeducP1 = mean(pubeduc)
bysort party1: egen classconP1 = mean(classcon)

bysort party1: egen tradvalP1 = mean(tradval)
bysort party1: egen sepchP1 = mean(sepch)

bysort party1: egen nationalismP1 = mean(nationalism)
bysort party1: egen langrightP1 = mean(langright)
bysort party1: egen grouprepP1 = mean(grouprep)
bysort party1: egen immigP1 = mean(immig)

bysort party1: egen otherissueP1 = mean(otherissue)


*Creating position vars for issues in 1897 averaging across EAs if several
bysort party1: egen p_greatergermanyP1 = mean(p_greatergermany)
bysort party1: egen p_warP1 = mean(p_war)
bysort party1: egen p_milservP1 = mean(p_milserv)
bysort party1: egen p_citarmyP1 = mean(p_citarmy)

bysort party1: egen p_demP1 = mean(p_dem)
bysort party1: egen p_elecinP1 = mean(p_elecin)
bysort party1: egen p_parlP1 = mean(p_parl)
bysort party1: egen p_civlibP1 = mean(p_civlib)
bysort party1: egen p_rulelawP1 = mean(p_rulelaw)
bysort party1: egen p_spechunP1 = mean(p_spechun)
bysort party1: egen p_fedP1 = mean(p_fed)
bysort party1: egen p_secP1 = mean(p_sec)

bysort party1: egen p_capismP1 = mean(p_capism)
bysort party1: egen p_ftradeP1 = mean(p_ftrade)
bysort party1: egen p_exploitP1 = mean(p_exploit)
bysort party1: egen p_growthP1 = mean(p_growth)
bysort party1: egen p_unempP1 = mean(p_unemp)
bysort party1: egen p_debtP1 = mean(p_debt)
bysort party1: egen p_interestP1 = mean(p_interest)
bysort party1: egen p_taxP1 = mean(p_tax)
bysort party1: egen p_corpP1 = mean(p_corp)
bysort party1: egen p_coopP1 = mean(p_coop)
bysort party1: egen p_trunionP1 = mean(p_trunion)
bysort party1: egen p_infraP1 = mean(p_infra)
bysort party1: egen p_pubsubP1 = mean(p_pubsub)
bysort party1: egen p_agriP1 = mean(p_agri)

bysort party1: egen p_soceqP1 = mean(p_soceq)
bysort party1: egen p_socsecP1 = mean(p_socsec)
bysort party1: egen p_pubhealthP1 = mean(p_pubhealth)
bysort party1: egen p_pubeducP1 = mean(p_pubeduc)
bysort party1: egen p_classconP1 = mean(p_classcon)

bysort party1: egen p_tradvalP1 = mean(p_tradval)
bysort party1: egen p_sepchP1 = mean(p_sepch)

bysort party1: egen p_nationalismP1 = mean(p_nationalism)
bysort party1: egen p_langrightP1 = mean(p_langright)
bysort party1: egen p_grouprepP1 = mean(p_grouprep)
bysort party1: egen p_immigP1 = mean(p_immig)


*Creating salience vars for groups in 1897 averaging across EAs if several
bysort party1: egen civicP1 = mean(civic)

bysort party1: egen uppclassP1 = mean(uppclass)
bysort party1: egen midclassP1 = mean(midclass)
bysort party1: egen lowclassP1 = mean(lowclass)
bysort party1: egen capistsP1 = mean(capists)
bysort party1: egen workersP1 = mean(workers)
bysort party1: egen arisP1 = mean(aris)
bysort party1: egen farmersP1 = mean(farmers)
bysort party1: egen merchP1 = mean(merch)
bysort party1: egen craftP1 = mean(craft)
bysort party1: egen civservP1 = mean(civserv)
bysort party1: egen soldiersP1 = mean(soldiers)
bysort party1: egen intellecP1 = mean(intellec)
bysort party1: egen producP1 = mean(produc)
bysort party1: egen consumP1 = mean(consum)

bysort party1: egen bosP1 = mean(bos)
bysort party1: egen croP1 = mean(cro)
bysort party1: egen czeP1 = mean(cze)
bysort party1: egen gerP1 = mean(ger)
bysort party1: egen hunP1 = mean(hun)
bysort party1: egen itaP1 = mean(ita)
bysort party1: egen jewP1 = mean(jew)
bysort party1: egen nomadicP1 = mean(nomadic)
bysort party1: egen polP1 = mean(pol)
bysort party1: egen romP1 = mean(rom)
bysort party1: egen rutP1 = mean(rut)
bysort party1: egen skP1 = mean(sk)
bysort party1: egen sloP1 = mean(slo)
bysort party1: egen slavP1 = mean(slav)
bysort party1: egen nongerP1 = mean(nonger)
bysort party1: egen nonhunP1 = mean(nonhun)

bysort party1: egen christP1 = mean(christ)
bysort party1: egen romcatP1 = mean(romcat)
bysort party1: egen protP1 = mean(prot)

bysort party1: egen provinceP1 = mean(province)
bysort party1: egen regionP1 = mean(region)
bysort party1: egen cityP1 = mean(city)
bysort party1: egen localP1 = mean(local)

bysort party1: egen conservativesP1 = mean(conservatives)
bysort party1: egen clericalsP1 = mean(clericals)
bysort party1: egen liberalsP1 = mean(liberals)
bysort party1: egen nationalistsP1 = mean(nationalists)
bysort party1: egen socialistsP1 = mean(socialists)

bysort party1: egen menP1 = mean(men)
bysort party1: egen womenP1 = mean(women)

bysort party1: egen oldP1 = mean(old)
bysort party1: egen youngP1 = mean(young)

bysort party1: egen othergrP1 = mean(othergr)


*Creating position vars for groups averaging across PPs if several
bysort party1: egen p_civicP1 = mean(p_civic)

bysort party1: egen p_uppclassP1 = mean(p_uppclass)
bysort party1: egen p_midclassP1 = mean(p_midclass)
bysort party1: egen p_lowclassP1 = mean(p_lowclass)
bysort party1: egen p_capitalistsP1 = mean(p_capitalists)
bysort party1: egen p_workersP1 = mean(p_workers)
bysort party1: egen p_arisP1 = mean(p_aris)
bysort party1: egen p_farmersP1 = mean(p_farmers)
bysort party1: egen p_merchP1 = mean(p_merch)
bysort party1: egen p_craftP1 = mean(p_craft)
bysort party1: egen p_civservP1 = mean(p_civserv)
bysort party1: egen p_soldiersP1 = mean(p_soldiers)
bysort party1: egen p_intellecP1 = mean(p_intellec)
bysort party1: egen p_producP1 = mean(p_produc)
bysort party1: egen p_consumP1 = mean(p_consum)

bysort party1: egen p_bosP1 = mean(p_bos)
bysort party1: egen p_croP1 = mean(p_cro)
bysort party1: egen p_czeP1 = mean(p_cze)
bysort party1: egen p_gerP1 = mean(p_ger)
bysort party1: egen p_hunP1 = mean(p_hun)
bysort party1: egen p_itaP1 = mean(p_ita)
bysort party1: egen p_jewP1 = mean(p_jew)
bysort party1: egen p_nomadicP1 = mean(p_nomadic)
bysort party1: egen p_polP1 = mean(p_pol)
bysort party1: egen p_romP1 = mean(p_rom)
bysort party1: egen p_rutP1 = mean(p_rut)
bysort party1: egen p_skP1 = mean(p_sk)
bysort party1: egen p_sloP1 = mean(p_slo)
bysort party1: egen p_slavP1 = mean(p_slav)
bysort party1: egen p_nongerP1 = mean(p_nonger)
bysort party1: egen p_nonhunP1 = mean(p_nonhun)

bysort party1: egen p_christP1 = mean(p_christ)
bysort party1: egen p_romcatP1 = mean(p_romcat)
bysort party1: egen p_protP1 = mean(p_prot)

bysort party1: egen p_provinceP1 = mean(p_province)
bysort party1: egen p_regionP1 = mean(p_region)
bysort party1: egen p_cityP1 = mean(p_city)
bysort party1: egen p_localP1 = mean(p_local)

bysort party1: egen p_conservativesP1 = mean(p_conservatives)
bysort party1: egen p_clericalsP1 = mean(p_clericals)
bysort party1: egen p_liberalsP1 = mean(p_liberals)
bysort party1: egen p_nationalistsP1 = mean(p_nationalists)
bysort party1: egen p_socialistsP1 = mean(p_socialists)

bysort party1: egen p_menP1 = mean(p_men)
bysort party1: egen p_womenP1 = mean(p_women)

bysort party1: egen p_oldP1 = mean(p_old)
bysort party1: egen p_youngP1 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1
keep party1 *P1
save "manifestos-PPpresuff.dta", replace






**** do the same for post suffrage period 
use "manifestos1", clear
keep if doc_type == "PP"
keep if postsuffrage_pp == 1


*Define which parties were nationalist according to core issue in EA 1907 
*Definition of nationalist party: majority of EA 1907 had 
*nationalism either as core issue 1 or as core issue 2

sort party1
bysort party1: gen sumdoc = _N
bysort party1: egen sumnatdoc2 = sum(natdoc2)
gen sharenatdoc2 = sumnatdoc2 / sumdoc
gen nationalistparty_P2 = 0
replace nationalistparty_P2 = 1 if sharenatdoc2 >= 0.5
label var nationalistparty_P2 "nationalist party PP2"


******Calculate variables for post suffrage PPs

bysort party1: egen forpolP2 = mean (forpol)
bysort party1: egen polsysP2 = mean (polsys)
bysort party1: egen econP2 = mean (econ)
bysort party1: egen socpolP2 = mean (socpol)
bysort party1: egen religmorP2 = mean (religmor)
bysort party1: egen nationalP2 = mean (national)

bysort party1: egen classP2 = mean (class)
bysort party1: egen nationalityP2 = mean (nationality)
bysort party1: egen religiousP2 = mean (religious)

bysort party1: egen territorialP2 = mean (territorial)
bysort party1: egen ideologicalP2 = mean (ideological)
bysort party1: egen genderP2 = mean (gender)
bysort party1: egen ageP2 = mean (age)


*Creating salience vars for issues in 1907 averaging across EAs if several
bysort party1: egen greatergermanyP2 = mean(greatergermany)
bysort party1: egen warP2 = mean(war)
bysort party1: egen milservP2 = mean(milserv)
bysort party1: egen citarmyP2 = mean(citarmy)

bysort party1: egen demP2 = mean(dem)
bysort party1: egen elecinP2 = mean(elecin)
bysort party1: egen parlP2 = mean(parl)
bysort party1: egen civlibP2 = mean(civlib)
bysort party1: egen rulelawP2 = mean(rulelaw)
bysort party1: egen spechunP2 = mean(spechun)
bysort party1: egen fedP2 = mean(fed)
bysort party1: egen secP2 = mean(sec)

bysort party1: egen capismP2 = mean(capism)
bysort party1: egen ftradeP2 = mean(ftrade)
bysort party1: egen exploitP2 = mean(exploit)
bysort party1: egen growthP2 = mean(growth)
bysort party1: egen unempP2 = mean(unemp)
bysort party1: egen debtP2 = mean(debt)
bysort party1: egen interestP2 = mean(interest)
bysort party1: egen taxP2 = mean(tax)
bysort party1: egen corpP2 = mean(corp)
bysort party1: egen coopP2 = mean(coop)
bysort party1: egen trunionP2 = mean(trunion)
bysort party1: egen infraP2 = mean(infra)
bysort party1: egen pubsubP2 = mean(pubsub)
bysort party1: egen agriP2 = mean(agri)

bysort party1: egen soceqP2 = mean(soceq)
bysort party1: egen socsecP2 = mean(socsec)
bysort party1: egen pubhealthP2 = mean(pubhealth)
bysort party1: egen pubeducP2 = mean(pubeduc)
bysort party1: egen classconP2 = mean(classcon)

bysort party1: egen tradvalP2 = mean(tradval)
bysort party1: egen sepchP2 = mean(sepch)

bysort party1: egen nationalismP2 = mean(nationalism)
bysort party1: egen langrightP2 = mean(langright)
bysort party1: egen grouprepP2 = mean(grouprep)
bysort party1: egen immigP2 = mean(immig)

bysort party1: egen otherissueP2 = mean(otherissue)


*Creating position vars for issues in 1897 averaging across EAs if several

bysort party1: egen p_greatergermanyP2 = mean(p_greatergermany)
bysort party1: egen p_warP2 = mean(p_war)
bysort party1: egen p_milservP2 = mean(p_milserv)
bysort party1: egen p_citarmyP2 = mean(p_citarmy)

bysort party1: egen p_demP2 = mean(p_dem)
bysort party1: egen p_elecinP2 = mean(p_elecin)
bysort party1: egen p_parlP2 = mean(p_parl)
bysort party1: egen p_civlibP2 = mean(p_civlib)
bysort party1: egen p_rulelawP2 = mean(p_rulelaw)
bysort party1: egen p_spechunP2 = mean(p_spechun)
bysort party1: egen p_fedP2 = mean(p_fed)
bysort party1: egen p_secP2 = mean(p_sec)

bysort party1: egen p_capismP2 = mean(p_capism)
bysort party1: egen p_ftradeP2 = mean(p_ftrade)
bysort party1: egen p_exploitP2 = mean(p_exploit)
bysort party1: egen p_growthP2 = mean(p_growth)
bysort party1: egen p_unempP2 = mean(p_unemp)
bysort party1: egen p_debtP2 = mean(p_debt)
bysort party1: egen p_interestP2 = mean(p_interest)
bysort party1: egen p_taxP2 = mean(p_tax)
bysort party1: egen p_corpP2 = mean(p_corp)
bysort party1: egen p_coopP2 = mean(p_coop)
bysort party1: egen p_trunionP2 = mean(p_trunion)
bysort party1: egen p_infraP2 = mean(p_infra)
bysort party1: egen p_pubsubP2 = mean(p_pubsub)
bysort party1: egen p_agriP2 = mean(p_agri)


bysort party1: egen p_soceqP2 = mean(p_soceq)
bysort party1: egen p_socsecP2 = mean(p_socsec)
bysort party1: egen p_pubhealthP2 = mean(p_pubhealth)
bysort party1: egen p_pubeducP2 = mean(p_pubeduc)
bysort party1: egen p_classconP2 = mean(p_classcon)

bysort party1: egen p_tradvalP2 = mean(p_tradval)
bysort party1: egen p_sepchP2 = mean(p_sepch)

bysort party1: egen p_nationalismP2 = mean(p_nationalism)
bysort party1: egen p_langrightP2 = mean(p_langright)
bysort party1: egen p_grouprepP2 = mean(p_grouprep)
bysort party1: egen p_immigP2 = mean(p_immig)


*Creating salience vars for groups in 1897 averaging across EAs if several
bysort party1: egen civicP2 = mean(civic)

bysort party1: egen uppclassP2 = mean(uppclass)
bysort party1: egen midclassP2 = mean(midclass)
bysort party1: egen lowclassP2 = mean(lowclass)
bysort party1: egen capistsP2 = mean(capists)
bysort party1: egen workersP2 = mean(workers)
bysort party1: egen arisP2 = mean(aris)
bysort party1: egen farmersP2 = mean(farmers)
bysort party1: egen merchP2 = mean(merch)
bysort party1: egen craftP2 = mean(craft)
bysort party1: egen civservP2 = mean(civserv)
bysort party1: egen soldiersP2 = mean(soldiers)
bysort party1: egen intellecP2 = mean(intellec)
bysort party1: egen producP2 = mean(produc)
bysort party1: egen consumP2 = mean(consum)

bysort party1: egen bosP2 = mean(bos)
bysort party1: egen croP2 = mean(cro)
bysort party1: egen czeP2 = mean(cze)
bysort party1: egen gerP2 = mean(ger)
bysort party1: egen hunP2 = mean(hun)
bysort party1: egen itaP2 = mean(ita)
bysort party1: egen jewP2 = mean(jew)
bysort party1: egen nomadicP2 = mean(nomadic)
bysort party1: egen polP2 = mean(pol)
bysort party1: egen romP2 = mean(rom)
bysort party1: egen rutP2 = mean(rut)
bysort party1: egen skP2 = mean(sk)
bysort party1: egen sloP2 = mean(slo)
bysort party1: egen slavP2 = mean(slav)
bysort party1: egen nongerP2 = mean(nonger)
bysort party1: egen nonhunP2 = mean(nonhun)

bysort party1: egen christP2 = mean(christ)
bysort party1: egen romcatP2 = mean(romcat)
bysort party1: egen protP2 = mean(prot)

bysort party1: egen provinceP2 = mean(province)
bysort party1: egen regionP2 = mean(region)
bysort party1: egen cityP2 = mean(city)
bysort party1: egen localP2 = mean(local)

bysort party1: egen conservativesP2 = mean(conservatives)
bysort party1: egen clericalsP2 = mean(clericals)
bysort party1: egen liberalsP2 = mean(liberals)
bysort party1: egen nationalistsP2 = mean(nationalists)
bysort party1: egen socialistsP2 = mean(socialists)

bysort party1: egen menP2 = mean(men)
bysort party1: egen womenP2 = mean(women)

bysort party1: egen oldP2 = mean(old)
bysort party1: egen youngP2 = mean(young)

bysort party1: egen othergrP2 = mean(othergr)


*Creating position vars for groups in 1907 averaging across EAs if several
bysort party1: egen p_civicP2 = mean(p_civic)

bysort party1: egen p_uppclassP2 = mean(p_uppclass)
bysort party1: egen p_midclassP2 = mean(p_midclass)
bysort party1: egen p_lowclassP2 = mean(p_lowclass)
bysort party1: egen p_capitalistsP2 = mean(p_capitalists)
bysort party1: egen p_workersP2 = mean(p_workers)
bysort party1: egen p_arisP2 = mean(p_aris)
bysort party1: egen p_farmersP2 = mean(p_farmers)
bysort party1: egen p_merchP2 = mean(p_merch)
bysort party1: egen p_craftP2 = mean(p_craft)
bysort party1: egen p_civservP2 = mean(p_civserv)
bysort party1: egen p_soldiersP2 = mean(p_soldiers)
bysort party1: egen p_intellecP2 = mean(p_intellec)
bysort party1: egen p_producP2 = mean(p_produc)
bysort party1: egen p_consumP2 = mean(p_consum)

bysort party1: egen p_bosP2 = mean(p_bos)
bysort party1: egen p_croP2 = mean(p_cro)
bysort party1: egen p_czeP2 = mean(p_cze)
bysort party1: egen p_gerP2 = mean(p_ger)
bysort party1: egen p_hunP2 = mean(p_hun)
bysort party1: egen p_itaP2 = mean(p_ita)
bysort party1: egen p_jewP2 = mean(p_jew)
bysort party1: egen p_nomadicP2 = mean(p_nomadic)
bysort party1: egen p_polP2 = mean(p_pol)
bysort party1: egen p_romP2 = mean(p_rom)
bysort party1: egen p_rutP2 = mean(p_rut)
bysort party1: egen p_skP2 = mean(p_sk)
bysort party1: egen p_sloP2 = mean(p_slo)
bysort party1: egen p_slavP2 = mean(p_slav)
bysort party1: egen p_nongerP2 = mean(p_nonger)
bysort party1: egen p_nonhunP2 = mean(p_nonhun)

bysort party1: egen p_christP2 = mean(p_christ)
bysort party1: egen p_romcatP2 = mean(p_romcat)
bysort party1: egen p_protP2 = mean(p_prot)

bysort party1: egen p_provinceP2 = mean(p_province)
bysort party1: egen p_regionP2 = mean(p_region)
bysort party1: egen p_cityP2 = mean(p_city)
bysort party1: egen p_localP2 = mean(p_local)

bysort party1: egen p_conservativesP2 = mean(p_conservatives)
bysort party1: egen p_clericalsP2 = mean(p_clericals)
bysort party1: egen p_liberalsP2 = mean(p_liberals)
bysort party1: egen p_nationalistsP2 = mean(p_nationalists)
bysort party1: egen p_socialistsP2 = mean(p_socialists)

bysort party1: egen p_menP2 = mean(p_men)
bysort party1: egen p_womenP2 = mean(p_women)

bysort party1: egen p_oldP2 = mean(p_old)
bysort party1: egen p_youngP2 = mean(p_young)


bysort party1: gen count = _n
keep if count == 1
keep party1 *P2
save "manifestos-PPpostsuff.dta", replace



******** 
****** Data merging ******* 

use "manifestos-EA1897.dta", clear

merge 1:1 party1 using "manifestos-EA1901.dta"
drop _merge

merge 1:1 party1 using "manifestos-EA1907.dta"
drop _merge

merge 1:1 party1 using "manifestos-EA1911.dta"
drop _merge


reshape long nationalistparty_E forpolE polsysE econE socpolE religmorE nationalE classE nationalityE religiousE territorialE ideologicalE genderE ageE greatergermanyE warE milservE citarmyE demE elecinE parlE civlibE rulelawE spechunE fedE secE capismE ftradeE exploitE growthE unempE debtE interestE taxE corpE coopE trunionE infraE pubsubE agriE soceqE socsecE pubhealthE pubeducE classconE tradvalE sepchE nationalismE langrightE grouprepE immigE otherissueE p_greatergermanyE p_warE p_milservE p_citarmyE p_demE p_elecinE p_parlE p_civlibE p_rulelawE p_spechunE p_fedE p_secE p_capismE p_ftradeE p_exploitE p_growthE p_unempE p_debtE p_interestE p_taxE p_corpE p_coopE p_trunionE p_infraE p_pubsubE p_agriE p_soceqE p_socsecE p_pubhealthE p_pubeducE p_classconE p_tradvalE p_sepchE p_nationalismE p_langrightE p_grouprepE p_immigE civicE uppclassE midclassE lowclassE capistsE workersE arisE farmersE merchE craftE civservE soldiersE intellecE producE consumE bosE croE czeE gerE hunE itaE jewE nomadicE polE romE rutE skE sloE slavE nongerE nonhunE christE romcatE protE provinceE regionE cityE localE conservativesE clericalsE liberalsE nationalistsE socialistsE menE womenE oldE youngE othergrE p_civicE p_uppclassE p_midclassE p_lowclassE p_capitalistsE p_workersE p_arisE p_farmersE p_merchE p_craftE p_civservE p_soldiersE p_intellecE p_producE p_consumE p_bosE p_croE p_czeE p_gerE p_hunE p_itaE p_jewE p_nomadicE p_polE p_romE p_rutE p_skE p_sloE p_slavE p_nongerE p_nonhunE p_christE p_romcatE p_protE p_provinceE p_regionE p_cityE p_localE p_conservativesE p_clericalsE p_liberalsE p_nationalistsE p_socialistsE p_menE p_womenE p_oldE p_youngE, i(party1) j(election) string

gen election_n = real(election)

drop election 

rename election_n election

order party1 election

drop if party1 == "other"

save "hmd-EA1-4", replace


import excel using "Party seats.xlsx", sheet("import") firstrow clear

merge 1:1 party1 election using "manifestos-EA1-4_allP.dta"
drop _merge

save "manifestos-EA1-4_allP.dta", replace



use "manifestos-PPpresuff.dta", clear

merge 1:1 party1 using "manifestos-PPpostsuff.dta"
drop _merge

reshape long nationalistpartyP forpolP polsysP econP socpolP religmorP nationalP classP nationalityP religiousP territorialP ideologicalP genderP ageP greatergermanyP warP milservP citarmyP demP elecinP parlP civlibP rulelawP spechunP fedP secP capismP ftradeP exploitP growthP unempP debtP interestP taxP corpP coopP trunionP infraP  pubsubP agriP soceqP socsecP pubhealthP pubeducP classconP tradvalP sepchP nationalismP langrightP grouprepP immigP otherissueP p_greatergermanyP p_warP p_milservP p_citarmyP p_demP p_elecinP p_parlP p_civlibP p_rulelawP p_spechunP p_fedP  p_secP p_capismP p_ftradeP p_exploitP p_growthP p_unempP p_debtP p_interestP p_taxP p_corpP p_coopP p_trunionP p_infraP p_pubsubP p_agriP p_soceqP p_socsecP p_pubhealthP p_pubeducP p_classconP p_tradvalP p_sepchP p_nationalismP p_langrightP p_grouprepP p_immigP civicP uppclassP midclassP lowclassP capistsP workersP arisP farmersP merchP craftP civservP soldiersP intellecP producP consumP bosP croP czeP gerP hunP itaP jewP nomadicP polP romP rutP skP sloP slavP nongerP nonhunP christP romcatP protP provinceP regionP cityP localP conservativesP clericalsP liberalsP nationalistsP socialistsP menP womenP oldP youngP othergrP p_civicP p_uppclassP p_midclassP p_lowclassP p_capitalistsP p_workersP p_arisP p_farmersP p_merchP p_craftP p_civservP p_soldiersP p_intellecP p_producP p_consumP p_bosP p_croP p_czeP p_gerP p_hunP p_itaP p_jewP p_nomadicP p_polP p_romP p_rutP p_skP p_sloP p_slavP p_nongerP p_nonhunP p_christP p_romcatP p_protP p_provinceP p_regionP p_cityP p_localP p_conservativesP p_clericalsP p_liberalsP p_nationalistsP p_socialistsP p_menP p_womenP p_oldP p_youngP, i(party1) j(postsuffrage_pp) string



order party1 postsuffrage_pp

drop if party1 == "other"

save "hmd-PP.dta", replace


